package com.example.video.plateRecognition.application.impl;

import com.example.video.plateRecognition.application.command.AbilityGetQryExe;
import com.example.video.plateRecognition.application.command.LicensePlateAddCmdExe;
import com.example.video.plateRecognition.application.command.LicensePlateDeleteCmdExe;
import com.example.video.plateRecognition.application.command.LicensePlateListQryExe;
import com.example.video.plateRecognition.client.api.PlateRecognitionService;
import com.example.video.plateRecognition.client.dto.LicensePlateAddCmd;
import com.example.video.plateRecognition.client.dto.LicensePlateDeleteCmd;
import com.example.video.plateRecognition.client.dto.LicensePlateListQry;
import com.example.video.plateRecognition.client.dto.LoginQry;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class PlateRecognitionServiceImpl implements PlateRecognitionService {

    @Autowired
    private LicensePlateDeleteCmdExe licensePlateDeleteCmdExe;

    @Autowired
    private LicensePlateAddCmdExe licensePlateAddCmdExe;

    @Autowired
    private LicensePlateListQryExe licensePlateListQryExe;

    @Autowired
    private AbilityGetQryExe abilityGetQryExe;


    @Override
    public void add(LicensePlateAddCmd command) {
        try{
            licensePlateAddCmdExe.execute(command);
        }catch (Exception e){
            System.out.println("下发失败");
        }

    }

    @Override
    public void delete(LicensePlateDeleteCmd command) {
        licensePlateDeleteCmdExe.execute(command);
    }

    @Override
    public void list(LicensePlateListQry command) {
        licensePlateListQryExe.execute(command);
    }

    @Override
    public String getDeviceSystemAbility(LoginQry qry) {
        return abilityGetQryExe.execute(qry);
    }
}
